Repository navigation
fix: make Qt5 (mips64el) build link DTK5 and deepin-pdfium5 - #463
Conversation
1. batchprint-convert reused reader sources but only got DTK include paths via imported targets (Qt6); in Qt5/DTK5 variable mode it built without any DTK includes and failed with "DApplication: No such file or directory" on shuttle. 2. libdeepin-pdfium and libdeepin-pdfium5 are built against Qt6/Qt5 respectively; their C++ ABI (QStringList/QVector mangling) is incompatible. The Qt5 build linked the Qt6 variant and failed with undefined allTextLooseRects. 3. Detect Qt before the pdfium check and pick the module per Qt version (deepin-pdfium / deepin-pdfium5), use the same variable in reader/batch-print/tests, add the libdeepin-pdfium5-dev alternative for mipsel/mips64el in debian/control, and pass DtkWidget/Gui/Core INCLUDE_DIRS/ LIBRARIES to batchprint-convert when DTK_USE_TARGETS is off. 4. Verified on a real mips64el Qt5 environment: full dpkg-buildpackage completes and produces the deb; Qt6 path unchanged (re-verified earlier on the same machine). Influence: 1. Verify the shuttle mips64el deb build completes end to end. 2. Verify amd64/arm64 (Qt6) builds are unaffected: configure picks deepin-pdfium and binaries link normally. 3. Spot check PDF word extraction / batch print on a Qt5 build. fix: Qt5(mips64el)构建补齐 DTK5 头文件并链接 deepin-pdfium5 1. batchprint-convert 复用 reader 源码,但 DTK 头文件路径此前 仅通过 Qt6 导入目标提供;Qt5/DTK5 变量模式下无任何 DTK 路径,shuttle 上报 "DApplication: No such file or directory"。 2. libdeepin-pdfium 与 libdeepin-pdfium5 分别基于 Qt6/Qt5 构建, C++ ABI(QStringList/QVector 名字修饰)互不兼容,Qt5 构建链 Qt6 变体导致 allTextLooseRects 符号找不到。 3. 将 Qt 检测提前,按 Qt 版本选择 pdfium 模块 (deepin-pdfium / deepin-pdfium5),reader/batch-print/tests 统一使用该变量;debian/control 为 mipsel/mips64el 增加 libdeepin-pdfium5-dev 备选;DTK_USE_TARGETS 关闭时向 batchprint-convert 传递 DtkWidget/Gui/Core 的 INCLUDE_DIRS 与 LIBRARIES。 4. 已在真实 mips64el Qt5 环境验证:dpkg-buildpackage 全量通过 并出包;Qt6 路径在同一台机器上此前已验证不受影响。 Influence: 1. 验证 shuttle mips64el 构建可端到端完成并出包。 2. 验证 amd64/arm64(Qt6)构建不受影响:configure 选择 deepin-pdfium 且链接正常。 3. 抽查 Qt5 构建产物的 PDF 取词与批量打印功能。 Log: No user-facing changes PMS: TASK-398545
Reviewer's GuideConfigurationSelect the PDFium package variant from the detected Qt version throughout the build, and declare the matching Qt5 package dependency for affected architectures.
Provide DTK5 include paths and libraries to batchprint-convert when imported DTK targets are unavailable.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="CMakeLists.txt" line_range="32" />
<code_context>
+if(QT_VERSION_MAJOR MATCHES 6)
+ set(DEEPIN_PDFIUM_MODULE deepin-pdfium)
+else()
+ set(DEEPIN_PDFIUM_MODULE deepin-pdfium5)
+endif()
find_package(PkgConfig REQUIRED)
</code_context>
<issue_to_address>
**Qt5 configuration stops with allowed dependencies**
When a Qt5 build resolves its PDFium dependency to only `libdeepin-pdfium-dev`, cMake's `pkg_check_modules` requires `deepin-pdfium5`, so configuration stops despite the permitted generic development package and the build never starts.
Make the Qt5 pkg-config module requirement match the PDFium development package that Debian can provide for Qt5.
Also at `CMakeLists.txt:35`.
</issue_to_address>
### Comment 2
<location path="CMakeLists.txt" line_range="33" />
<code_context>
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,relro -Wl,-z,now")
endif()
+# 查找Qt版本(需先于 PDF 引擎模块选择:Qt5 构建走 deepin-pdfium5)
</code_context>
<issue_to_address>
**Qt5 qmake builds keep wrong PDF engine**
When a caller uses the documented qmake build with Qt5, `reader/src.pri` still requests the Qt6 `deepin-pdfium` pkg-config module, so the documented Qt5 qmake build links an ABI-incompatible engine and fails with unresolved PDFium symbols.
Select `deepin-pdfium5` in the qmake configuration when building with Qt5, including for tests.
</issue_to_address>| if(QT_VERSION_MAJOR MATCHES 6) | ||
| set(DEEPIN_PDFIUM_MODULE deepin-pdfium) | ||
| else() | ||
| set(DEEPIN_PDFIUM_MODULE deepin-pdfium5) |
There was a problem hiding this comment.
🟡 Medium · Qt5 configuration stops with allowed dependencies
When a Qt5 build resolves its PDFium dependency to only libdeepin-pdfium-dev, cMake's pkg_check_modules requires deepin-pdfium5, so configuration stops despite the permitted generic development package and the build never starts.
Make the Qt5 pkg-config module requirement match the PDFium development package that Debian can provide for Qt5.
Also at CMakeLists.txt:35.
Prompt for AI agents
In `CMakeLists.txt` at line 32:
**Qt5 configuration stops with allowed dependencies**
When a Qt5 build resolves its PDFium dependency to only `libdeepin-pdfium-dev`, cMake's `pkg_check_modules` requires `deepin-pdfium5`, so configuration stops despite the permitted generic development package and the build never starts.
Make the Qt5 pkg-config module requirement match the PDFium development package that Debian can provide for Qt5.
Also at `CMakeLists.txt:35`.| set(DEEPIN_PDFIUM_MODULE deepin-pdfium) | ||
| else() | ||
| set(DEEPIN_PDFIUM_MODULE deepin-pdfium5) | ||
| endif() |
There was a problem hiding this comment.
🟠 High · Qt5 qmake builds keep wrong PDF engine
When a caller uses the documented qmake build with Qt5, reader/src.pri still requests the Qt6 deepin-pdfium pkg-config module, so the documented Qt5 qmake build links an ABI-incompatible engine and fails with unresolved PDFium symbols.
Select deepin-pdfium5 in the qmake configuration when building with Qt5, including for tests.
Prompt for AI agents
In `CMakeLists.txt` at line 33:
**Qt5 qmake builds keep wrong PDF engine**
When a caller uses the documented qmake build with Qt5, `reader/src.pri` still requests the Qt6 `deepin-pdfium` pkg-config module, so the documented Qt5 qmake build links an ABI-incompatible engine and fails with unresolved PDFium symbols.
Select `deepin-pdfium5` in the qmake configuration when building with Qt5, including for tests.|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, pengfeixx The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/merge |
Summary
The shuttle mips64el package build fails in two stages when falling back to Qt5 (the chroot has no qmake6, so
debian/rulespicks Qt5):batchprint-convertreuses reader sources (Global.cppetc. includeDApplication/DGuiApplicationHelper), but the target only received DTK include paths via Qt6 imported targets. In Qt5/DTK5 variable mode (DTK_USE_TARGETS=OFF) it got no DTK includes:undefined reference to DPdfPage::allTextLooseRects(int&, QStringList&, QVector<QRectF>&).libdeepin-pdfiumandlibdeepin-pdfium5are built against Qt6/Qt5 respectively; the C++ symbol mangling of Qt container types is incompatible, so a Qt5 consumer cannot link the Qt6-built variant.Changes
CMakeLists.txt: move the Qt detection before the pdfium check; select the pkg-config module per Qt version (deepin-pdfiumfor Qt6,deepin-pdfium5for Qt5)reader/CMakeLists.txt,batch-print/CMakeLists.txt,tests/CMakeLists.txt: use${DEEPIN_PDFIUM_MODULE}(tests is a standalone project and gets its own selection)batch-print/CMakeLists.txt: whenDTK_USE_TARGETSis OFF, pass${DtkWidget,Gui,Core}_INCLUDE_DIRS/_LIBRARIEStobatchprint-convert(mirrors what the reader target already does)debian/control: addlibdeepin-pdfium5-dev (>= 1.5.7) [mipsel mips64el] | libdeepin-pdfium-dev (>= 1.5.8)alternativeNo C++ source changes; the Qt6 build path is untouched.
Testing
dpkg-buildpackage -bcompletes and producesdeepin-reader_6.6.5_mips64el.deb; configure logsFound Qt version: 5,module: deepin-pdfium5git interpret-trailers --parseon the commit messagePMS: TASK-398545
Summary by Sourcery
Enable successful Qt5 builds on mips architectures while preserving the existing Qt6 build path.
Bug Fixes:
Enhancements:
Build: